using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Extract
{
    /// <summary>
    /// <para>Table Select</para>
    /// <para>Selects table records matching a Structured Query Language (SQL) expression and writes them to an output table.</para>
    /// <para>选择与结构化查询语言 （SQL） 表达式匹配的表记录，并将其写入输出表。</para>
    /// </summary>    
    [DisplayName("Table Select")]
    public class TableSelect : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TableSelect()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The table containing records matching the specified expression that will be written to the output table.</para>
        /// <para>包含与将写入输出表的指定表达式匹配的记录的表。</para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output Table</para>
        /// <para>The output table containing records from the input table that match the specified expression.</para>
        /// <para>输出表，其中包含输入表中与指定表达式匹配的记录。</para>
        /// </param>
        public TableSelect(object _in_table, object _out_table)
        {
            this._in_table = _in_table;
            this._out_table = _out_table;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Table Select";

        public override string CallName => "analysis.TableSelect";

        public override List<string> AcceptEnvironments => ["configKeyword"];

        public override object[] ParameterInfo => [_in_table, _out_table, _where_clause];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The table containing records matching the specified expression that will be written to the output table.</para>
        /// <para>包含与将写入输出表的指定表达式匹配的记录的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Output Table</para>
        /// <para>The output table containing records from the input table that match the specified expression.</para>
        /// <para>输出表，其中包含输入表中与指定表达式匹配的记录。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Expression</para>
        /// <para><xdoc>
        ///   <para>An SQL expression used to select a subset of records.</para>
        ///   <para>An SQL expression used to select a subset of records. For more information on SQL syntax, see SQL reference for elements used in query expressions.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于选择记录子集的 SQL 表达式。</para>
        ///   <para>用于选择记录子集的 SQL 表达式。有关 SQL 语法的详细信息，请参阅查询表达式中使用的元素的 SQL 参考。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        public TableSelect SetEnv(object configKeyword = null)
        {
            base.SetEnv(configKeyword: configKeyword);
            return this;
        }

    }

}